#ifndef F_CAServerE_h
#define F_CAServerE_h


//******************************************************************************
// EDROOM Service Library

#define _EDROOM_IS_DEBUG_

#define _EDROOM_IS_EMBEDDED_

#include <public/edroomsl.h>


//******************************************************************************
// Required Software Interfaces

#include <caserver/required_swi.h>
//******************************************************************************
// Component Class   CAServer

class CAServer: public CEDROOMComponent {

public:

	//*********************** Component Signal Enum Type ***********************

	 enum EDROOMCAServerSignal { EDROOMSignalTimeout, EDROOMSignalDestroy, SResAck, SResNack, SResReq, SFreeRes };

	//***************************** Component Memory ***************************

	class CEDROOMMemory: public CEDROOMComponentMemory{

		private:

			//CQueueHead

			CEDROOMQueue::CQueueHead QueueHeads[EDROOMprioMINIMUM+1];

			//Pools

			public:

			TEDROOMUInt8	poolTEDROOMUInt8[10];
			TEDROOMBool	poolMarkTEDROOMUInt8[10];


			// SetMemory
			void SetMemory(TEDROOMUInt32 numMessages_, CEDROOMMessage * MessagesMem_, TEDROOMBool * MessagesMemMarks_, CEDROOMQueue::CQueueNode * QueueNodesMem_, TEDROOMBool * QueueNodesMemMarks_);

	};


	//*****************************	Component Ports ****************************

	CEDROOMInterface	pService4;
	CEDROOMInterface	pService3;
	CEDROOMInterface	pService2;
	CEDROOMInterface	pService1;




	// ******************************** Constructor ****************************

	CAServer(const char * const roomname, TEDROOMComponentID id, TEDROOMUInt32 roomNumMaxMens, TEDROOMPriority roomtaskPrio, TEDROOMStackSizeType roomStack, CEDROOMMemory * pActorMemory );




	// *************************************************************************

	// **************************** Public Methods	****************************

	// *************************************************************************



	// **************************** Configuration ******************************

	 int EDROOMConfig();


	// ************************************* Start *****************************

	 int EDROOMStart();




	#ifdef _EDROOM_SYSTEM_CLOSE

	// ***************************** IsComponentFinished ***********************

	TEDROOMBool EDROOMIsComponentFinished();


	#endif

	// *************************************************************************

	// **************************** Protected Methods	************************

	// *************************************************************************

protected:



	// *********************************** Behaviour ***************************

	virtual void EDROOMBehaviour();




public:

	// *****************************	Behaviour File *************************

	#include <caserver/CAServerC.h>


protected:

	// ********************************  Top State  ****************************

	EDROOMTopState edroomTopState;



};
#endif
